<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.9.0">
<meta name="baidu-site-verification" content="pFajzJd0SZ" />
<meta name="google-site-verification" content="nWFVcb4qcdyxOeW2mwDvLXa4UOsZdsGAH5uKR5PFG_o" />
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Fira Code:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"jiangchenrui.gitee.io","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":true,"scrollpercent":false},"bookmark":{"enable":true,"color":"#222","save":"manual"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":false,"nav":null,"activeClass":"valine"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="random函数的一些用法">
<meta name="keywords" content="python,numpy,笔记">
<meta property="og:type" content="article">
<meta property="og:title" content="numpy.random函数的一些用法">
<meta property="og:url" content="https://JiangChenrui.gitee.io/2019/01/23/numpy-random函数的一些用法/index.html">
<meta property="og:site_name" content="姜晨瑞的博客">
<meta property="og:description" content="random函数的一些用法">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2021-07-29T01:57:23.160Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="numpy.random函数的一些用法">
<meta name="twitter:description" content="random函数的一些用法">

<link rel="canonical" href="https://JiangChenrui.gitee.io/2019/01/23/numpy-random函数的一些用法/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>numpy.random函数的一些用法 | 姜晨瑞的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">姜晨瑞的博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">记录与总结</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://JiangChenrui.gitee.io/2019/01/23/numpy-random函数的一些用法/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="JiangChenrui">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="姜晨瑞的博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          numpy.random函数的一些用法
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-01-23 19:07:20" itemprop="dateCreated datePublished" datetime="2019-01-23T19:07:20+08:00">2019-01-23</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-07-29 09:57:23" itemprop="dateModified" datetime="2021-07-29T09:57:23+08:00">2021-07-29</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2019/01/23/numpy-random函数的一些用法/" class="post-meta-item leancloud_visitors" data-flag-title="numpy.random函数的一些用法" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2019/01/23/numpy-random函数的一些用法/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/01/23/numpy-random函数的一些用法/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>5.9k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>5 分钟</span>
            </span>
            <div class="post-description"><center>random函数的一些用法</center></div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p><a href="https://blog.csdn.net/u012149181/article/details/78913167" target="_blank" rel="noopener">参考博客</a></p>
<h2 id="numpy-random-rand"><a href="#numpy-random-rand" class="headerlink" title="numpy.random.rand()"></a>numpy.random.rand()</h2><p>numpy.random.rand(d0, d1, …, dn)  </p>
<ul>
<li><p>rand函数根据给定维度生成[0,1)之间的数据，包含0，不包含1  </p>
</li>
<li><p>dn表示每个维度  </p>
</li>
<li><p>返回值为指定维度的array</p>
</li>
</ul>
<p>输入  </p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.rand(<span class="number">4</span>, <span class="number">2</span>) <span class="comment"># 生成4行两列0-1之间的随机数</span></span><br></pre></td></tr></table></figure>
<p>输出</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">array([[ <span class="number">0.2639652</span> ,  <span class="number">0.67762924</span>],</span><br><span class="line">       [ <span class="number">0.50164586</span>,  <span class="number">0.73739781</span>],</span><br><span class="line">       [ <span class="number">0.18457953</span>,  <span class="number">0.85558988</span>],</span><br><span class="line">       [ <span class="number">0.16193526</span>,  <span class="number">0.83935579</span>]])</span><br></pre></td></tr></table></figure>
<p>输入</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.rand(<span class="number">4</span>, <span class="number">3</span>, <span class="number">2</span>) <span class="comment"># shape为[4, 3, 2]</span></span><br></pre></td></tr></table></figure>
<p>输出</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">array([[[ <span class="number">0.49636822</span>,  <span class="number">0.89954378</span>],</span><br><span class="line">        [ <span class="number">0.5711387</span> ,  <span class="number">0.41691163</span>],</span><br><span class="line">        [ <span class="number">0.05681485</span>,  <span class="number">0.88512829</span>]],</span><br><span class="line"></span><br><span class="line">       [[ <span class="number">0.88798283</span>,  <span class="number">0.96294557</span>],</span><br><span class="line">        [ <span class="number">0.91100035</span>,  <span class="number">0.28982022</span>],</span><br><span class="line">        [ <span class="number">0.90098484</span>,  <span class="number">0.85539872</span>]],</span><br><span class="line"></span><br><span class="line">       [[ <span class="number">0.99124126</span>,  <span class="number">0.87069271</span>],</span><br><span class="line">        [ <span class="number">0.82365864</span>,  <span class="number">0.33025856</span>],</span><br><span class="line">        [ <span class="number">0.8874623</span> ,  <span class="number">0.22067393</span>]],</span><br><span class="line"></span><br><span class="line">       [[ <span class="number">0.62666929</span>,  <span class="number">0.71956291</span>],</span><br><span class="line">        [ <span class="number">0.81974729</span>,  <span class="number">0.46510244</span>],</span><br><span class="line">        [ <span class="number">0.03494486</span>,  <span class="number">0.11045034</span>]]])</span><br></pre></td></tr></table></figure>
<h3 id="numpy-random-randn"><a href="#numpy-random-randn" class="headerlink" title="numpy.random.randn()"></a>numpy.random.randn()</h3><p>numpy.random.randn(d0,d1,…,dn)  </p>
<ul>
<li><p>randn函数返回一个或一组样本，具有标准正态分布.  </p>
</li>
<li><p>dn表示每个维度  </p>
</li>
<li><p>返回值为指定维度的array  </p>
</li>
</ul>
<p>标准正态分布是以0为均值，1为标准差的正态分布，记为N(0, 1)。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.randn(<span class="number">4</span>, <span class="number">2</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">-0.599153380810341</span></span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.randn(<span class="number">4</span>, <span class="number">2</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">array([[<span class="number">-0.83173279</span>, <span class="number">-0.06084999</span>],</span><br><span class="line">       [ <span class="number">0.30143042</span>, <span class="number">-0.63863605</span>],</span><br><span class="line">       [<span class="number">-0.45491282</span>,  <span class="number">0.72084355</span>],</span><br><span class="line">       [<span class="number">-0.86603523</span>,  <span class="number">1.14210338</span>]])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.randn(<span class="number">4</span>, <span class="number">3</span>, <span class="number">2</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">array([[[ <span class="number">0.62674807</span>, <span class="number">-0.40911062</span>],</span><br><span class="line">        [<span class="number">-0.65785551</span>,  <span class="number">0.85653665</span>],</span><br><span class="line">        [<span class="number">-0.55250578</span>,  <span class="number">1.15478597</span>]],</span><br><span class="line"></span><br><span class="line">       [[<span class="number">-1.39797824</span>,  <span class="number">1.36343765</span>],</span><br><span class="line">        [<span class="number">-0.35807181</span>,  <span class="number">2.08002524</span>],</span><br><span class="line">        [<span class="number">-0.16746821</span>,  <span class="number">1.89978231</span>]],</span><br><span class="line"></span><br><span class="line">       [[<span class="number">-0.89490747</span>, <span class="number">-0.49563846</span>],</span><br><span class="line">        [ <span class="number">0.36720155</span>, <span class="number">-0.30631295</span>],</span><br><span class="line">        [ <span class="number">0.43208381</span>,  <span class="number">1.04328295</span>]],</span><br><span class="line"></span><br><span class="line">       [[<span class="number">-0.65629808</span>,  <span class="number">0.501748</span>  ],</span><br><span class="line">        [ <span class="number">0.30889304</span>, <span class="number">-0.52872014</span>],</span><br><span class="line">        [ <span class="number">0.04584062</span>, <span class="number">-0.05242994</span>]]])</span><br></pre></td></tr></table></figure>
<h2 id="numpy-random-randint"><a href="#numpy-random-randint" class="headerlink" title="numpy.random.randint()"></a>numpy.random.randint()</h2><p>numpy.random.randint(low, high=None, size=None, dtype=’l’)</p>
<ul>
<li><p>返回随机整数，范围区间为[low,high），包含low，不包含high  </p>
</li>
<li><p>参数：low为最小值，high为最大值，size为数组维度大小，dtype为数据类型，默认的数据类型是np.int  </p>
</li>
<li><p>high没有填写时，默认生成随机数的范围是[0，low)  </p>
</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.randint(<span class="number">1</span>, size=<span class="number">5</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array([<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.randint(<span class="number">1</span>, <span class="number">5</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">2</span></span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.randint(<span class="number">-5</span>, <span class="number">5</span>, size=[<span class="number">2</span>,<span class="number">2</span>])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">array([[ <span class="number">1</span>,  <span class="number">0</span>],</span><br><span class="line">       [<span class="number">-3</span>,  <span class="number">2</span>]])</span><br></pre></td></tr></table></figure>
<h3 id="numpy-random-random-integers"><a href="#numpy-random-random-integers" class="headerlink" title="numpy.random.random_integers"></a>numpy.random.random_integers</h3><p>numpy.random.random_integers(low, high=None, size=None)</p>
<ul>
<li><p>返回随机整数，范围区间为[low,high]，包含low和high  </p>
</li>
<li><p>参数：low为最小值，high为最大值，size为数组维度大小  </p>
</li>
<li><p>high没有填写时，默认生成随机数的范围是[1，low]  </p>
</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.random_integers(<span class="number">5</span>, size=<span class="number">5</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array([<span class="number">5</span>, <span class="number">4</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">1</span>])</span><br></pre></td></tr></table></figure>
<h2 id="生成-0-1-之间的浮点数"><a href="#生成-0-1-之间的浮点数" class="headerlink" title="生成[0,1)之间的浮点数"></a>生成[0,1)之间的浮点数</h2><ul>
<li><p>numpy.random.random_sample(size=None)  </p>
</li>
<li><p>numpy.random.random(size=None)  </p>
</li>
<li><p>numpy.random.ranf(size=None)  </p>
</li>
<li><p>numpy.random.sample(size=None)  </p>
</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">print(<span class="string">'-----------random_sample--------------'</span>)</span><br><span class="line">print(np.random.random_sample(size=(<span class="number">2</span>,<span class="number">2</span>)))</span><br><span class="line">print(<span class="string">'-----------random--------------'</span>)</span><br><span class="line">print(np.random.random(size=(<span class="number">2</span>,<span class="number">2</span>)))</span><br><span class="line">print(<span class="string">'-----------ranf--------------'</span>)</span><br><span class="line">print(np.random.ranf(size=(<span class="number">2</span>,<span class="number">2</span>)))</span><br><span class="line">print(<span class="string">'-----------sample--------------'</span>)</span><br><span class="line">print(np.random.sample(size=(<span class="number">2</span>,<span class="number">2</span>)))</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">-----------random_sample--------------</span><br><span class="line">[[ <span class="number">0.19678647</span>  <span class="number">0.64750281</span>]</span><br><span class="line"> [ <span class="number">0.70380805</span>  <span class="number">0.18626702</span>]]</span><br><span class="line">-----------random--------------</span><br><span class="line">[[ <span class="number">0.05688147</span>  <span class="number">0.57224742</span>]</span><br><span class="line"> [ <span class="number">0.5821726</span>   <span class="number">0.8344959</span> ]]</span><br><span class="line">-----------ranf--------------</span><br><span class="line">[[ <span class="number">0.57307708</span>  <span class="number">0.08199258</span>]</span><br><span class="line"> [ <span class="number">0.50676558</span>  <span class="number">0.79959829</span>]]</span><br><span class="line">-----------sample--------------</span><br><span class="line">[[  <span class="number">2.25676224e-04</span>   <span class="number">8.76885950e-01</span>]</span><br><span class="line"> [  <span class="number">7.52204914e-01</span>   <span class="number">6.43694560e-01</span>]]</span><br></pre></td></tr></table></figure>
<h2 id="numpy-random-choice"><a href="#numpy-random-choice" class="headerlink" title="numpy.random.choice()"></a>numpy.random.choice()</h2><p>numpy.random.choice(a, size=None, replace=True, p=None)  </p>
<ul>
<li><p>从给定的一维数组中生成随机数  </p>
</li>
<li><p>参数： a为一维数组类似数据或整数；size为数组维度；p为数组中的数据出现的概率  </p>
</li>
<li><p>a为整数时，对应的一维数组为np.arange(a)  </p>
</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.choice(<span class="number">5</span>, <span class="number">3</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array([<span class="number">4</span>, <span class="number">4</span>, <span class="number">2</span>])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">np.random.choice(<span class="number">5</span>, <span class="number">3</span>, replace=<span class="keyword">False</span>)</span><br><span class="line"><span class="comment"># replace为False时，生成的数不能有重复的</span></span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array([<span class="number">0</span>, <span class="number">3</span>, <span class="number">1</span>])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">np.random.choice(<span class="number">4</span>, <span class="number">4</span>, replace=<span class="keyword">False</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">array([<span class="number">1</span>, <span class="number">0</span>, <span class="number">2</span>, <span class="number">3</span>])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">np.random.choice(<span class="number">4</span>, size=(<span class="number">3</span>, <span class="number">2</span>))</span><br><span class="line">array([[<span class="number">2</span>, <span class="number">1</span>],</span><br><span class="line">       [<span class="number">2</span>, <span class="number">3</span>],</span><br><span class="line">       [<span class="number">1</span>, <span class="number">1</span>]])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">demo_list = [<span class="string">'lenovo'</span>, <span class="string">'sansumg'</span>,<span class="string">'moto'</span>,<span class="string">'xiaomi'</span>, <span class="string">'iphone'</span>]</span><br><span class="line">np.random.choice(demo_list,size=(<span class="number">3</span>,<span class="number">3</span>))</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">array([[<span class="string">'lenovo'</span>, <span class="string">'sansumg'</span>, <span class="string">'lenovo'</span>],</span><br><span class="line">       [<span class="string">'moto'</span>, <span class="string">'sansumg'</span>, <span class="string">'sansumg'</span>],</span><br><span class="line">       [<span class="string">'sansumg'</span>, <span class="string">'iphone'</span>, <span class="string">'moto'</span>]],</span><br><span class="line">      dtype=<span class="string">'&lt;U7'</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># p是指定每个元素的概率，概率和应为1，且数据个数与a应该相同</span></span><br><span class="line">demo_list = [<span class="string">'lenovo'</span>, <span class="string">'sansumg'</span>,<span class="string">'moto'</span>,<span class="string">'xiaomi'</span>, <span class="string">'iphone'</span>]</span><br><span class="line">np.random.choice(demo_list,size=(<span class="number">3</span>,<span class="number">3</span>), p=[<span class="number">0.1</span>,<span class="number">0.6</span>,<span class="number">0.1</span>,<span class="number">0.1</span>,<span class="number">0.1</span>])</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">array([[<span class="string">'sansumg'</span>, <span class="string">'sansumg'</span>, <span class="string">'iphone'</span>],</span><br><span class="line">       [<span class="string">'sansumg'</span>, <span class="string">'sansumg'</span>, <span class="string">'xiaomi'</span>],</span><br><span class="line">       [<span class="string">'sansumg'</span>, <span class="string">'sansumg'</span>, <span class="string">'sansumg'</span>]],</span><br><span class="line">      dtype=<span class="string">'&lt;U7'</span>)</span><br></pre></td></tr></table></figure>
<h2 id="numpy-random-seed"><a href="#numpy-random-seed" class="headerlink" title="numpy.random.seed()"></a>numpy.random.seed()</h2><ul>
<li><p>np.random.seed()的作用：使得随机数据可预测。  </p>
</li>
<li><p>当我们设置相同的seed，每次生成的随机数相同。如果不设置seed，则每次会生成不同的随机数  </p>
</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">10</span>):</span><br><span class="line">    np.random.seed(<span class="number">2</span>)</span><br><span class="line">    print(np.random.rand(<span class="number">5</span>))</span><br><span class="line">    print(np.random.rand(<span class="number">5</span>))</span><br><span class="line">    print(np.random.rand(<span class="number">5</span>))</span><br><span class="line">    print(np.random.rand(<span class="number">5</span>))</span><br><span class="line">    print()</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br></pre></td><td class="code"><pre><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br><span class="line"></span><br><span class="line">[ <span class="number">0.4359949</span>   <span class="number">0.02592623</span>  <span class="number">0.54966248</span>  <span class="number">0.43532239</span>  <span class="number">0.4203678</span> ]</span><br><span class="line">[ <span class="number">0.33033482</span>  <span class="number">0.20464863</span>  <span class="number">0.61927097</span>  <span class="number">0.29965467</span>  <span class="number">0.26682728</span>]</span><br><span class="line">[ <span class="number">0.62113383</span>  <span class="number">0.52914209</span>  <span class="number">0.13457995</span>  <span class="number">0.51357812</span>  <span class="number">0.18443987</span>]</span><br><span class="line">[ <span class="number">0.78533515</span>  <span class="number">0.85397529</span>  <span class="number">0.49423684</span>  <span class="number">0.84656149</span>  <span class="number">0.07964548</span>]</span><br></pre></td></tr></table></figure>
    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>JiangChenrui
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://JiangChenrui.gitee.io/2019/01/23/numpy-random函数的一些用法/" title="numpy.random函数的一些用法">https://JiangChenrui.gitee.io/2019/01/23/numpy-random函数的一些用法/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/python/" rel="tag"># python</a>
              <a href="/tags/numpy/" rel="tag"># numpy</a>
              <a href="/tags/笔记/" rel="tag"># 笔记</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2019/01/23/ShuffleNetV2/" rel="prev" title="ShuffleNetV2">
      <i class="fa fa-chevron-left"></i> ShuffleNetV2
    </a></div>
      <div class="post-nav-item">
    <a href="/2019/01/23/LeetCode刷题总结/" rel="next" title="LeetCode刷题总结">
      LeetCode刷题总结 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#numpy-random-rand"><span class="nav-number">1.</span> <span class="nav-text">numpy.random.rand()</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#numpy-random-randn"><span class="nav-number">1.1.</span> <span class="nav-text">numpy.random.randn()</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#numpy-random-randint"><span class="nav-number">2.</span> <span class="nav-text">numpy.random.randint()</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#numpy-random-random-integers"><span class="nav-number">2.1.</span> <span class="nav-text">numpy.random.random_integers</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#生成-0-1-之间的浮点数"><span class="nav-number">3.</span> <span class="nav-text">生成[0,1)之间的浮点数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#numpy-random-choice"><span class="nav-number">4.</span> <span class="nav-text">numpy.random.choice()</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#numpy-random-seed"><span class="nav-number">5.</span> <span class="nav-text">numpy.random.seed()</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="JiangChenrui"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">JiangChenrui</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">31</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">13</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">28</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/JiangChenrui" title="GitHub → https://github.com/JiangChenrui" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.liaoxuefeng.com/" title="https://www.liaoxuefeng.com/" rel="noopener" target="_blank">廖雪峰</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://charlesliuyx.github.io/" title="https://charlesliuyx.github.io/" rel="noopener" target="_blank">遥行</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://redstonewill.com/" title="https://redstonewill.com/" rel="noopener" target="_blank">红色石头</a>
        </li>
    </ul>
  </div>

      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-mouse"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">JiangChenrui</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">121k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">1:50</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>
<script src="/js/utils.js"></script><script src="/js/motion.js"></script>
<script src="/js/schemes/pisces.js"></script>
<script src="/js/next-boot.js"></script><script src="/js/bookmark.js"></script>



  




  <script src="/js/local-search.js"></script>












  

  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'cUdEljn6k666MrHJYr6FhqSe-gzGzoHsz',
      appKey     : 'yrwQQpoA00WVm649FXM7AKqW',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-cn' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</body>
</html>
